FUNCTION A : INT
    VAR_INPUT
        X : INT;
    END_VAR
    IF X = 2 THEN
        A := 1;
    ELSIF X = 1 THEN
        A := 1;
    ELSE
        A := A(X := X-1) + A(X := X-2);
    END_IF
END_FUNCTION

PROGRAM P
    A(X := 10);
END_PROGRAM